Skip to content

Conversation

@jiafu1115
Copy link
Contributor

@jiafu1115 jiafu1115 commented Oct 12, 2025

Hi Team:

Currently, the AdminClient’s describeConsumerGroups API returns a
MemberDescription that does not include rack information, even though
the underlying ConsumerGroupDescribeResponse protocol already supports a
rackId field. This causes users to be unable to retrieve member rack
information through the Admin API.

Rack information is crucial for:

  1. Monitoring and visualization tools
  2. Operational analysis of rack distribution
  3. Diagnosing rack-aware assignment issues

In addition, StreamsGroupMemberDescription already includes the rackId,
so adding it here would make the behavior more consistent.

BTW, I have currently implemented our AZ/Rack analysis using a
workaround — passing the rack information into the clientId field and
parsing it afterward.

kafkaConsumerConfig.customConfig(ConsumerConfig.CLIENT_ID_CONFIG,
generateClientIdWithRack(ip, rack));

image

So I propose this change with tiny code change to support this feature.
After the change. We can easy to get all the rack info for every
consumer by the API:
Admin#describeConsumerGroups(java.util.Collection<java.lang.String>)

Thanks for review!

Reviewers: Andrew Schofield [email protected]

@github-actions github-actions bot added triage PRs from the community clients small Small PRs labels Oct 12, 2025
@AndrewJSchofield AndrewJSchofield added the kip Requires or implements a KIP label Oct 12, 2025
@AndrewJSchofield
Copy link
Member

Hi @jiafu1115 . Thanks for the PR. This would be a tiny change to a public interface and that means it needs an accompanying KIP. It would be a small KIP and not at all controversial I think. Would you like to create the KIP or would you like me to do this? Also, note that MemberDescription is also used by share groups, and those too are able to fill in the rack ID using information already present in the protocol response.

@jiafu1115
Copy link
Contributor Author

Hi @jiafu1115 . Thanks for the PR. This would be a tiny change to a public interface and that means it needs an accompanying KIP. It would be a small KIP and not at all controversial I think. Would you like to create the KIP or would you like me to do this? Also, note that MemberDescription is also used by share groups, and those too are able to fill in the rack ID using information already present in the protocol response.

Hi. @AndrewJSchofield Thanks for your review and reminder. I will create one KIP for the workflow and check the shared group code according to your suggestion.

@github-actions github-actions bot added tools and removed small Small PRs labels Oct 13, 2025
@jiafu1115
Copy link
Contributor Author

@AndrewJSchofield Update: KIP https://cwiki.apache.org/confluence/display/KAFKA/KIP-1227%3A+Expose+Rack+ID+in+MemberDescription+and+ShareMemberDescription created and I also updated the change for share group. We can wait one week before the vote to collect feedbacks though it is one tiny change.

@AndrewJSchofield AndrewJSchofield self-requested a review October 13, 2025 09:31
@AndrewJSchofield AndrewJSchofield added ci-approved and removed triage PRs from the community labels Oct 13, 2025
@github-actions github-actions bot added the small Small PRs label Oct 13, 2025
@jiafu1115 jiafu1115 changed the title KAFKA-19784: Expose Rack ID in MemberDescription KAFKA-19784: Expose rack ID in MemberDescription and ShareMemberDescription Oct 13, 2025
@jiafu1115
Copy link
Contributor Author

Update: I fixed the compile/check style issues and squashed the commits.
BTW, it seems the test is flaky, regardless of the changes in this PR.

@jiafu1115
Copy link
Contributor Author

jiafu1115 commented Oct 22, 2025

Hi @AndrewJSchofield . The KIP has been accepted, Thanks a lot!

So we can move forward now. I built the client SDK with the branch and tested it with the following cases today. I think the results meet my expectations. I’m sharing them with you for your review! Thanks!

Case 1

kafka 4.1
client: set the rack and group.protocol=consumer

test result:
[(memberId=9Qlf0K6gSzC1FZ6hcTHxPg, groupInstanceId=null, rackId=us-east-1a, clientId=consumer-new_consume_group-1, host=/10.224.49.116, assignment=(topicPartitions=test_topic-2,test_topic-1,test_topic-0), targetAssignment=Optional[(topicPartitions=test_topic-2,test_topic-1,test_topic-0)], memberEpoch=1, upgraded=true)]

Case 2

kafka 4.1
client: set the rack only

test result:
[(memberId=Lcg5NrPXQrK04J6Txz3E6w, groupInstanceId=null, rackId=null, clientId=consumer-new_consume_group-1, host=/10.224.49.116, assignment=(topicPartitions=test_topic-1,test_topic-0,test_topic-2), targetAssignment=Optional.empty, memberEpoch=null, upgraded=null)]

Case 3

kafka3.9
client: set the rack

test result:
[(memberId=3dc3-419e-a7ee-f112bfc622ac, groupInstanceId=null, rackId=null, clientId=5488f769c8-vl97x, host=/10.51.88.67, assignment=(topicPartitions=test_topic-0), targetAssignment=Optional.empty, memberEpoch=null, upgraded=null),

Case 4

kafka 4.1-Share Group
server: group.share.enable=true
client: set the rack

test result:
[(memberId=tjq3E3xdQ9S6UB1wIkQL7w, rackId=us-east-1a, clientId=consumer-new_consume_group_shard-1, host=/10.224.49.116, assignment=(topicPartitions=test_topic-1,test_topic-0,test_topic-2), memberEpoch=2)]

Case 5

kafka 4.1-Share Group
server: group.share.enable=true
client: no set the rack

test result:
[(memberId=xq-7K6o_SBWao-_E7ER-Gw, rackId=null, clientId=consumer-new_consume_group_shard2-1, host=/10.224.49.116, assignment=(topicPartitions=test_topic-2,test_topic-1,test_topic-0), memberEpoch=2)]

@jiafu1115 jiafu1115 changed the title KAFKA-19784: Expose rack ID in MemberDescription and ShareMemberDescription KAFKA-19784_KIP-1227: Expose rack ID in MemberDescription and ShareMemberDescription Oct 22, 2025
Copy link
Member

@AndrewJSchofield AndrewJSchofield left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates. Just very minor comments this time. Will be ready to merge soon.

@github-actions github-actions bot removed the small Small PRs label Oct 26, 2025
@jiafu1115 jiafu1115 force-pushed the rack branch 2 times, most recently from e565e04 to cd4511c Compare October 26, 2025 23:27
@jiafu1115
Copy link
Contributor Author

jiafu1115 commented Oct 27, 2025

@AndrewJSchofield Done for all the changed. Help to review it again. Really appreciate it!

@AndrewJSchofield AndrewJSchofield changed the title KAFKA-19784_KIP-1227: Expose rack ID in MemberDescription and ShareMemberDescription KAFKA-19784: KIP-1227: Expose rack ID in MemberDescription and ShareMemberDescription Oct 27, 2025
@AndrewJSchofield AndrewJSchofield merged commit 7a8dba3 into apache:trunk Oct 27, 2025
23 checks passed
@jiafu1115
Copy link
Contributor Author

@AndrewJSchofield Thank you so much for your thorough review and continuous follow-up — really appreciate it!

@AndrewJSchofield
Copy link
Member

@jiafu1115 Thanks for your first KIP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-approved clients kip Requires or implements a KIP tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants